﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using AttributeRouting;
using AttributeRouting.Web.Mvc;
using Invoicing.Model.Orders;
using Invoicing.Logic.Orders;
namespace Invoicing.Web.Management.Areas.Orders.Controllers
{
    [RouteArea("Orders")]
    [RoutePrefix("PaidOrder")]
    [Authorize]
    public class PaidOrderController : Controller
    {
        [Route("")]
        public ActionResult Index()
        {
            return View();
        }

        [Route("NewOrder/{method:int}")]
        public ActionResult NewOrder(int method)
        {
            ViewBag.Method = method;
            return View();
        }

        [Route("Order/{orderNo}")]
        public ActionResult Order(string orderNo)
        {
            PaidOrderModel model = null;
            if (!string.IsNullOrEmpty(orderNo))
                model = PaidOrderLogic.GetOrder(orderNo);
            return PartialView(model);
        }

        [Route("Print/{orderNo}")]
        public ActionResult Print(string orderNo)
        {
            PaidOrderModel model = null;
            if (!string.IsNullOrEmpty(orderNo))
                model = PaidOrderLogic.GetOrder(orderNo);
            return View(model);
        }
    }
}
